MTG Collection Manager

By Tobi Alade (aoa34) & Raina Hoffmann (roh27)
Fall 2023


Demonstration Video


Introduction

In the multiverse of Magic: The Gathering (MTG), the complexity and variety of the card collection is what makes the game so great. It is easy to see a common challenge among players: the task of organizing and managing extensive card collections. Inspired by this, we developed a system that not only autonomously digitizes MTG cards, but also simplifies the management and tracking of these collections. Our project brings many elements of engineering together with our physical feeder mechanism to our QT user interface and our SQLite database. We strived to create a solution that blends practical utility with the engaging world of MTG. This project challenged us to push our boundaries, expand our skills to find ways to bring this project together.


Generic placeholder image

Project Objective:

  • A system for scanning and storing MTG cards in an easily accessible and exportable digital collection.
  • A relational database backend for sorting on the collection.
  • An intuitive and responsive user experience with the piTFT.

Hardware

The foundation of our hardware design was inspired by an existing project on Instructables, which we modified to suit our specific needs. The core structure was built using home-made ultra-strong cardboard, Lego wheels and axles, and standard hardware store parts. A notable contribution to our design was 2 pen springs, generously provided by our professor, which became an essential component in the card feeder mechanism as it pulled the top and bottom tracks together, allowing the rubber wheels to grip the cards.

Full Mechanism Image
Full mechanism view of the card feeder.

Reinforcing Image
Reinforcing the cardboard with sticks.

Spackle Image
Reinforcing the cardboard edges with spackle.

Pen Springs Image
Pen springs used in the card feeder mechanism.

Camera Mount and Dropbox Image
Camera mount and dropbox setup for card scanning.

Servo and Gears Image
Behind-the-scenes view of the servo and gears.

We constructed a light foam drop box to catch the cards post-scanning. We initially had our camera and scanning location more towards the front. But found much more consistent success on card scans after moving it farther away from the motion This new design ensures much more orderly handling of the cards as they pass through the system. To integrate the scanning functionality, we modified the design by adding attachments that perfectly position the camera for optimal card recognition. This setup was crucial for accurate image capture, which directly impacts the system's effectiveness in card digitization.

One of the significant challenges we encountered was the unavailability of a specific gear crucial for the feeder mechanism. To overcome this, we turned to 3D printing, which allowed us to fabricate a custom gear that precisely met our requirements.

Hardware Hiccups

  • Feeder Mechanism Tolerance: The feeder mechanism struggled to dispense cards singly and consistently, likely due to the high tolerance of our 3D printed gears. Future improvements include using the exact Lego gear from the Technic set, which was unfortunately not available during development.
  • Project Pivot: Mid-project, we pivoted from an adaptive posture monitor to this card digitization system. Despite the time pressure, we successfully executed the new project scope.
  • Lighting Challenges: Different lighting posed significant issues, especially with glare affecting card scans. We had not enough light in our usual testing environment and too much light in the lab. We adapted mid-demo by using a piece of green paper found in the lab to reduce glare, optimizing our demonstration conditions.

Software

The software architecture of our system is the core of our digitization magic. Our approach utilized the following libraries/APIs:

System Architecture
This diagram illustrates the comprehensive UI workflow of our application, showcasing the seamless integration of the various software components.


Card Processing Workflow:
  1. We initiated card feeding and scanning on a new QThread.
  2. Text recognition via AWS Rekognition.
  3. Card data was then fetched from Scryfall and stored in our SQLite3 database.
  4. We utilized SQL queries for filtering the database.
  5. Emailing users their collection was handled through Linux commands.

Software Hiccups


Testing

Our testing protocol was comprehensive, we started with a variety of MTG cards across different filters to ensure the robustness of our card recognition and sorting algorithms. We included both older and newer cards to make sure almost any magic card would be covered. We meticulously adjusted the feeder timings and PWM values to fine-tune the card dispensing process. The challenges with lighting due to card glare were addressed by modifying the environment and scanner placement.

The switch from Tesseract to AWS Rekognition was also part of our testing process. While testing Tesseract we noticed nothing we would do would work well for magic cards. We dramatically improved the accuracy of text recognition by making the move. Through these rigorous testing phases, we honed both the hardware precision and software responsiveness of our system, making a reliable and user-friendly platform for MTG card collection management. Although our feeder is not perfect it is in a pretty good state.


Results

The project culminated in a sophisticated system that not only scans and digitizes Magic: The Gathering cards but also offers a dynamic user interface for collection management. Each card is able to be scanned with precision, and its data extracted and stored. The system demonstrates very high accuracy, with card's details easily viewable after scanning. Users can now easily filter, sort, and search through their collections, making the management of even the largest card collections a seamless and enjoyable task. The only thing we were unable to get to was card condition assessment but it is coming soon in the next version!


Conclusions

In conclusion, our project successfully achieved its goal of creating a digitized management system for MTG card collections. The project leveraged a combination of hardware and software integration, including 3D-printed components, computer vision, database management, and a GUI to provide a seamless user experience. The system's ability to adapt to various cards and the intuitive interface design highlights our functionality and user-friendliness.


Future Work

Work Distribution

Generic placeholder image

Project group picture

Generic placeholder image

Tobi

aoa34@cornell.edu

  • Vision System code
  • Database System code
  • Feeder System code
  • Frontend implementation
  • Integration of backend with frontend
Generic placeholder image

Raina

roh27@cornell.edu

  • Physical construction
  • UI design
  • Device wiring
  • Frontend implementation
  • Integration of backend with frontend

Source Code

Access our code here: https://github.com/AbioticFactor/mtg-collection-manager


Parts List

Total: $68.00


References

Base feeder build
Bootstrap
Pigpio Library
SQLiteCPP Library
QT documentation
AWS documentation
ECE 5725: Labs 1 - 4
Student Website (campus congestion guide)
Professor Skovira